function [nrTargets, olTargets, olBins] = ST_OrderedTargetList(targetList)
%ST_OrderedTargetList Summary of this function goes here
% Detailed explanation goes here
rows = size(targetList, 1);
cols = size(targetList, 2);

nrTargets = 0;
for row_nr = 1:rows
  for col_nr = 1:cols
    if targetList(row_nr, col_nr) <= 0
      break;
    else
      nrTargets = nrTargets + 1;
    end
  end
end

olTargets(1:nrTargets) = NaN;
olBins(1:nrTargets) = NaN;
current = 1;
for row_nr = 1:rows
  for col_nr = 1:cols
    if targetList(row_nr, col_nr) <= 0
      break;
    else
      olTargets(current) = targetList(row_nr, col_nr);
      olBins(current) = row_nr;
      current = current + 1;
    end
  end
end
end